import request from '@/utils/request'

// 创建商户单退单
export function createAppMerchantOrderRefund(data) {
  return request({
    url: '/pekingfish/app-merchant-order-refund/create',
    method: 'post',
    data: data
  })
}

// 更新商户单退单
export function updateAppMerchantOrderRefund(data) {
  return request({
    url: '/pekingfish/app-merchant-order-refund/update',
    method: 'put',
    data: data
  })
}

// 删除商户单退单
export function deleteAppMerchantOrderRefund(id) {
  return request({
    url: '/pekingfish/app-merchant-order-refund/delete?id=' + id,
    method: 'delete'
  })
}

// 获得商户单退单
export function getAppMerchantOrderRefund(id) {
  return request({
    url: '/pekingfish/app-merchant-order-refund/get?id=' + id,
    method: 'get'
  })
}

// 获得商户单退单分页
export function getAppMerchantOrderRefundPage(query) {
  return request({
    url: '/pekingfish/app-merchant-order-refund/page',
    method: 'get',
    params: query
  })
}

// 导出商户单退单 Excel
export function exportAppMerchantOrderRefundExcel(query) {
  return request({
    url: '/pekingfish/app-merchant-order-refund/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}


export function confirmRefund(id,merchantOrderNo,refundPrice) {
  const data = {
    id,
    merchantOrderNo,
    refundPrice
  }
  return request({
    url: '/pekingfish/app-merchant-order-refund/confirmRefund',
    method: 'put',
    data: data
  })
}


export function refundGoods(id,trackingNumber) {
  const data = {
    id,
    trackingNumber
  }
  return request({
    url: '/pekingfish/app-merchant-order-refund/refundGoods',
    method: 'put',
    data: data
  })
}

